package main;

import java.util.ArrayList;
import java.util.List;

import model.UserGen;
import ulity.ParserXml;

public class Register {
  public static void main(String arg[]) throws Exception{
	  
	  List<UserGen>  users = ParserXml.readUser("data/user2.xml");
		List<AutoUser> autos = new ArrayList<AutoUser>();
		for(int i = 0;i<users.size();i++){
			//Thread.sleep(20);
			System.out.println(i);
			//Connection c = new Connection();
			autos.add(new AutoUser(users.get(i).getUserName(), users.get(i).getPass()));
		}
		for(int i =0; i<autos.size();i++){
			Thread.sleep(100);
			autos.get(i).register();
		}
		
	  /*
		Thread t = new Thread(new Runnable() {
			
			@Override
			public void run() {
				// TODO Auto-generated method stub
				try {
					Connection connection = new Connection();
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
	 	t.start();
	 	
	 	Thread t2 = new Thread(new Runnable() {
			
			@Override
			public void run() {
				// TODO Auto-generated method stub
				try {
					Connection connection2 = new Connection();
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
	 	t2.start();
	 	*/
	 
  }
}
